<?php
/**
 * 订单验证器
 */

namespace app\common\validate;

class OrderValidate extends CommonBaseValidate
{
    protected $rule = [
            'user_id|用户' => 'require',
    'shop_id|商户' => 'require',
    'order_no|订单号' => 'require',
    'all_num|数量' => 'require',
    'all_money|总金额' => 'require',
    'pay_money|支付金额' => 'require',
    'status|状态' => 'require',

    ];

    protected $message = [
            'user_id.required' => '用户不能为空',
    'shop_id.required' => '商户不能为空',
    'order_no.required' => '订单号不能为空',
    'all_num.required' => '数量不能为空',
    'all_money.required' => '总金额不能为空',
    'pay_money.required' => '支付金额不能为空',
    'status.required' => '状态不能为空',

    ];

    protected $scene = [
        'admin_add'     => ['user_id', 'shop_id', 'order_no', 'type', 'all_num', 'all_money', 'pay_money', 'status', ],
        'admin_edit'    => ['id', 'user_id', 'shop_id', 'order_no', 'type', 'all_num', 'all_money', 'pay_money', 'status', ],
        'admin_del'     => ['id', ],
        'admin_disable' => ['id', ],
        'admin_enable'  => ['id', ],
        'api_add'       => ['user_id', 'shop_id', 'order_no', 'type', 'all_num', 'all_money', 'pay_money', 'status', ],
        'api_info'      => ['id', ],
        'api_edit'      => ['id', 'user_id', 'shop_id', 'order_no', 'type', 'all_num', 'all_money', 'pay_money', 'status', ],
        'api_del'       => ['id', ],
        'api_disable'   => ['id', ],
        'api_enable'    => ['id', ],
    ];
}
